package com.totoro.tymapping.executor.condition.impl;

import com.totoro.tymapping.constants.ConditionConst;
import com.totoro.tymapping.executor.condition.ConditionExecutor;
import org.bukkit.entity.Player;
import org.bukkit.inventory.ItemStack;

/**
 * @author Totoro
 * @version 0.1.0
 * @date 2025/8/13 - 15:40
 * @description
 **/
public class PermissionExecutor implements ConditionExecutor {
    @Override
    public Boolean execute(String condition, Player player, ItemStack matchItem) {
        String finalCondition = getFinalCondition(condition, ConditionConst.PERMISSION);
        return player.hasPermission(finalCondition);
    }
}
